﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace OperaHouse.Web.Models
{
    public class ContactModel
    {
        public int Id { get; set; }

        [StringLength(100)]
        [Required(ErrorMessage = "Nhập tên")]
        public string Name { get; set; }
        
        public string Phone { get; set; }

        public string Address { get; set; }

        [RegularExpression("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$", ErrorMessage = "Email không hợp lệ")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        public string Body { get; set; }

        public DateTime CreatedOn { get; set; }
    }
}